1. Field of the Invention
The present invention relates to a communication terminal device such as a terminal printer, terminal display, deposit terminal, or other such device used, for example, in an automated transaction machine (ATM), cash dispenser (CD), point-of-sale (POS) system, or kiosk terminal installed in a retail store. More particularly, the present invention relates to processing received data temporarily stored in a receive buffer when the terminal device stops its native operation because of a prescribed condition such as an off-line state.
2. Description of Related Art
Conventional transaction devices such as ATMs, CDs, POS terminals, kiosk terminals, and the like contain a central processing device (such as a personal computer or host terminal) and various terminal devices providing specific functions. Exemplary of these terminal devices are printers, displays, cash dispensing and storage devices, and bar code readers. The central processing device, referred to as the host device below, systematically controls the overall operation of the ATM, POS, or other terminal (referred to below as transaction devices), as well as individual control of the other terminal devices built into the transaction device. More specifically, the host sends control commands and other relevant data to a particular terminal device to control the operation of the terminal device. Most such terminal devices built into the transaction device are connected to the host device by way of a serial port (RS-232C or other) connection whereby commands and process data such as print data are transferred.
An interface circuit is built into each of these devices, and a control line for controlling communication is provided in the connection. For example, the terminal device can output a data terminal ready (DTR) signal to notify the host device that the terminal device is in a data receivable state. When the host detects an active DTR signal, it sets the data set ready (DSR) signal to an active state to confirm that both devices are enabled for data communication before sending any data, and thereby prevents data loss. Terminal devices such as the above are referred to in this specification as xe2x80x9ccommunication terminal devices.xe2x80x9d
Conventionally a communication terminal device such as a terminal printer (referred to as simply a printer below) stores data received from the host to a receive buffer. The stored received data is interpreted by a command interpreter in the sequence the data is received. After interpreted, the data is removed from the receive buffer to make space in the receive buffer. If the interpreted data is a command, the command is executed and then deleted from the receive buffer.
If the terminal device has gone off-line because the cover is open, a paper jam occurred, or some other reason has caused the terminal device to stop its native operation, the command interpreter also stops interpreting the received data and thus stops operation. If the host continues to send data when the terminal device is off-line, the receive buffer soon becomes full (a receive buffer full state) because processing of data in the receive buffer has stopped.
When the receive buffer becomes full, data received thereafter cannot be stored to the receive buffer and is therefore lost. To prevent this, the terminal device sets the DTR signal inactive when the receive buffer becomes full, and thus stops data transmission from the host.
On the other hand, when the communication terminal device goes off-line, the host needs to confirm the communication terminal device status and run a process appropriate to the communication terminal device status. The host must therefore send a control command to the communication terminal device which is in the offline state causing the communication terminal device to perform a specific operation such as reporting the device status to the host. Some communication terminal devices accomplish this by providing a special type of command data, referred to below as a real-time command, that is executed as soon as the command is received by the communication terminal device and is then stored to the receive buffer. The real-time command is stored to the receive buffer after execution to prevent the loss of binary data when the code sequence mistakenly processed as a real-time command is actually part of the binary data sequence of an image data stream, for example.
When the communication terminal device goes off-line, the host typically sends frequent real-time commands to the communication terminal device in order to determine the status of the communication terminal device in detail. These real-time commands are executed as soon as received by the communication terminal device and are then stored to the receive buffer as mentioned before.
On the other hand, because the command interpreter does not interpret data stored in the receive buffer while off-line, the receive buffer soon becomes filled with the real-time commands sent from the host and other data previously stored therein. Once the receive buffer is full, the host device is prohibited to send further data, and the communication terminal device therefore cannot be controlled by the host device.
An object of the present invention is therefore to prevent loss of receive buffer functionality as a result of received data unnecessary accumulating in the receive buffer. For example, interpreting data stored in the receive buffer continues even when a native operation of a communication terminal device has stopped due to an error, for example, and then the requested operation will be performed after communication terminal device operation is again possible.
In order to achieve the above object, the communication terminal apparatus of the present invention includes interface means for performing data communication with a host apparatus; storage means for storing data; first data processing means for storing the data received by the interface means in the storage means; interpretation means for reading the received data stored in the storage means in the order in which the received data are stored, and for interpreting the read data; detection means for detecting predetermined data from the received data interpreted by the interpretation means; second data processing means for storing control information corresponding to the received data interpreted by the interpretation means in the storage means in the order in which the received data are interpreted, except for the predetermined data detected by the detection means; and first control means for controlling the communication terminal apparatus based on the control information stored in the storage means.
According to this aspect of the present invention, the control information based on predetermined data, such as a real command, which has already been executed, is not stored in the storage means, thereby enabling the efficient use of the storage means.
In this case, the communication terminal apparatus may preferably further include deletion means for deleting the received data read by the interpretation means from the storage means.
The storage means may preferably further include a first area for storing the received data and a second area for storing the control information. In a printer, which serves as the communication terminal apparatus, a large amount of various items of data, such as control commands and print data, are sent to a receiving buffer. Accordingly, the sequentially analyzing and processing the contents of the receiving buffer, as is performed in the present invention, is very effective for the efficient use of the receiving buffer. In this case, the control information may preferably include printing control information and print data, and the second data processing means may preferably store the printing control information and the print data while relating them to each other. The storage means may preferably include a printing control information area for storing the printing control information and a print data area for storing the print data. The second data processing means may preferably add addresses within the print data area in which the print data related to the printing control information are stored to the printing control information, and may store the printing control information in the printing control information area.
The aforementioned communication terminal apparatus may preferably further include data detection means for detecting the predetermined data from the received data before the received data are stored in the storage means by the first data processing means; and second control means for controlling the communication terminal apparatus with a higher priority than the first control means according to the predetermined data detected by the data detection means. In this case, the second control means may send status data of the communication terminal apparatus to the host apparatus according to the predetermined data.
According to the above-described aspect of the present invention, a real time command, which is predetermined data, is executed before it is stored in the receiving buffer or simultaneously with being stored therein. It is thus possible for the host apparatus to perform predetermined control by the real time command even in an offline status. Software of the host apparatus is also able to know details of the status of the communication terminal apparatus regardless of the operating status of the communication terminal apparatus, thereby making it possible to perform appropriate processing according to the status.
The above-described communication terminal apparatus may preferably further include status detection means for detecting a predetermined status of the communication terminal apparatus; and interruption means for interrupting an operation of the first control means according to a detection result of the status detection means. In this case, the interpretation means may preferably interpret the received data even if the first control means is in an interrupting state.
With the above-described arrangement, the interpretation means interprets the data even if the first control means is in an interrupting state. Accordingly, even if the operation of the communication terminal apparatus is interrupted due to the opening of the cover or a paper jam, command analyses are performed on the data stored in the receiving buffer. Thus, the set-up operation for executing commands (for example, set-up operation for print data) can be performed, and the received data storage area of the storage means can be released.
The present invention can also be implemented by a received data processing method for use in the above-described communication terminal apparatus, and operations and advantages similar to those offered by the communication terminal apparatus can be achieved. Additionally, the received data processing method for use in the communication terminal apparatus of the present invention may preferably be performed by using a computer, such as a microprocessor, installed in the communication terminal apparatus. In this case, a computer program product, such as a computer readable recording medium, which stores a computer program for implementing the above method by using a computer, is also included in the technical scope of the present invention.
Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.